
 if( SERVER ) then

	AddCSLuaFile( "shared.lua" );

end


 

SWEP.PrintName      = "Support builder"   
SWEP.Slot         = 0;
SWEP.SlotPos            = 3;
SWEP.Description        = "Builds an item in front of you."
SWEP.Contact            = ""
SWEP.Purpose            = ""
SWEP.Instructions      = "Left Click to build a brrier, right click to build a dispenser."

 
SWEP.Spawnable      = true --  Change to false to make Admin only.
SWEP.AdminSpawnable  = true
 
SWEP.ViewModel      = "models/weapons/v_c4.mdl"
SWEP.WorldModel   = "models/weapons/w_c4.mdl"
 
SWEP.Primary.Recoil  = 0
SWEP.Primary.ClipSize      = -1
SWEP.Primary.DefaultClip    = 1
SWEP.Primary.Automatic    = false
SWEP.Primary.Delay    = 30
SWEP.Primary.Ammo      = "none"
 
SWEP.Secondary.Recoil      = 0
SWEP.Secondary.ClipSize  = -1
SWEP.Secondary.DefaultClip  = 1
SWEP.Secondary.Automatic    = false
SWEP.Secondary.Delay        = 30
SWEP.Secondary.Ammo  = "none"
 

util.PrecacheSound("buttons/button1.wav")
util.PrecacheSound("buttons/combine_button_locked.wav")

function SWEP:PrimaryAttack()
	if self.Owner:GetNWInt("ClkFired") == 0 then
		self.Weapon:SetNextPrimaryFire( CurTime() + 5 )
		self.Owner:EmitSound("buttons/button1.wav", 150, 100)
		self.Owner:ConCommand("dm_barrier")
	else
		self.Owner:EmitSound("buttons/combine_button_locked.wav", 150, 100)
	end
end

function SWEP:SecondaryAttack()
	self.Weapon:SetNextPrimaryFire( CurTime() + 5 )
	self.Owner:EmitSound("buttons/button1.wav", 150, 100)
	self.Owner:ConCommand("dm_disp")
end